<template>
    <div class="customer-statistics">
        <div class="customer-statistics-header">
            <div class="customer-statistics-title">客户统计</div>
        </div>

        <ElTable v-loading="loading" :data="list" max-height="320">
            <ElTableColumn type="index" label="#" :width="50" align="center" />
            <ElTableColumn prop="t" label="分类" />
            <ElTableColumn prop="z" label="值" />
        </ElTable>
    </div>
</template>

<script setup lang="ts">
import { ref, onMounted } from 'vue'
import { getStatistics1 } from '../api'


const loading = ref(false)
const list = ref([])

const getData = () => {
  loading.value = true
  getStatistics1({})
    .then(res => {
      list.value = res || []
    })
    .finally(() => {
      loading.value = false
    })
}
onMounted(() => {
  getData()
})

</script>

<style scoped lang="scss">
.customer-statistics {
    height: 400px;
    padding: 20px;
    box-sizing: border-box;

    &-title {
        font-family: PingFangSC-Medium;
        font-weight: 500;
        font-size: 16px;
        color: #333333;
        margin-bottom: 16px;
    }

    &-header {
        font-family: PingFangSC-Medium;
        font-weight: 500;
        font-size: 16px;
        color: #333333;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
}
</style>